<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../../style/common.css" />
<script src="../../js/jquery-2.0.2.min.js"></script>
<title>保健所検索</title>
<script type="text/javascript">
function onLoad() {
	window.android.doGetHoKenJoAreaList();
}


function setArea() {
	var jouhou = window.android.getHokenjoAreaList();
	var areaList = document.getElementById("areaselect");
	var locationList = document.getElementById("locationselect");
	if (null == jouhou || jouhou.size() == 0) {
		areaList.disabled = true;

	} else {
		areaList.options.add(new Option("", ""));
		for ( var i = 0; i < jouhou.size(); i++) {
			areaList.options.add(new Option(jouhou.get(i), jouhou.get(i)));
		}
	}
	if (areaList.value == "") {
		locationList.disabled = true;
	} else {
		locationList.disabled = false;
	}
	window.android.stopProgressBar();
}

function changed() {
	var areaList = document.getElementById("areaselect");
	var curstr = areaList.value;
	var locationList = document.getElementById("locationselect");
	window.android.doGetHoKenJoLocationList(curstr);
	if (areaList.value == "") {
		locationList.disabled = true;
	} else {
		locationList.disabled = false;
	}
}

function setLocation() {
	var jouhou = window.android.getHokenjoLocationList();
	var locationList = document.getElementById("locationselect");
	locationList.options.length = 0;
	locationList.options.add(new Option("", ""));
	for ( var i = 0; i < jouhou.size(); i++) {
		locationList.options.add(new Option(jouhou.get(i), jouhou.get(i)));
	}
	window.android.stopProgressBar();
}

function search(){
	var areaList = document.getElementById("areaselect");
	var area = areaList.value;
	var locationList = document.getElementById("locationselect");
	var location = locationList.value;
	if (area == "" || location == "") {
		window.android.checkAlert();
	} else {
		window.android.doGetHoKenJoList(area, location);
	}
}
function setTable() {
	var jouhou = window.android.getHoKenJoList();
	var total = jouhou.size();
	var x = document.getElementById("jouhoutable");
	for ( var j = x.rows.length - 1; j >= 0; j--) {
		x.deleteRow(j);
	}
	for ( var i = 0; i < total; i++) {
		var x1 = x.insertRow(i);
		var y1 = x1.insertCell(0);
		var newTable = document.createElement('table');
		newTable.border = 1;
		newTable.width = "100%";
		newTable.style.borderCollapse = "collapse";
		newTable.style.border = "none";
		newTable.style.fontSize = "14px";
		y1.appendChild(newTable);
		var tr1 = newTable.insertRow(0);
		var td11 = tr1.insertCell(0);
		td11.innerHTML = jouhou.get(i).getSite();
		td11.colSpan = 2;
		var tr2 = newTable.insertRow(1);
		var td21 = tr2.insertCell(0);
		td21.width = "30%";
		var td22 = tr2.insertCell(1);
		td21.innerHTML = jouhou.get(i).getZipCode();
		td22.innerHTML = jouhou.get(i).getAddress();
		var tr3 = newTable.insertRow(2);
		var td31 = tr3.insertCell(0);
		td31.innerHTML = jouhou.get(i).getContact();
		td31.colSpan = 2;
		
	}
	window.android.stopProgressBar();
}
</script>
</head>

<body onload="onLoad()">
	<table width="100%" border="0">
		<tr>
			<td colspan="2"><b>保健所検索</b>
				<hr class="title_divison life_theme_background_color" /></td>
		</tr>
		<tr>
			<td>ここから保健所が検索できます。</td>
		</tr>
		<tr>
			<td colspan="2">
				<table width="100%" border="0">
					<tr><td　colspan="2"><a>地域をプルダウンメニューで選択する。</a></td></tr>
					<tr>
						<td width="50%"><a>都道府県</a><br /> <select id="areaselect"
							onchange="changed()"></select></td>
						<td width="50%"><a>市区町村</a><br /> <select
							id="locationselect" onchange="search()"></select></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td><br />
				<table width="100%" id="jouhoutable">
				</table></td>
		</tr>
		<tr>
			<td><br />
				<table width="100%" border="0">
					<tr>
						<td>
							<div class="back_button"
								onclick="location.href='S3-1110-1.html';">&lt;&nbsp;もどる</div>
						</td>
					</tr>
				</table></td>
		</tr>
	</table>
</body>
</html>
